import { otherRequest,request } from '@/sheep/request';

export default {
	// 团购收益提现
	tuangou_income_get: (data) =>
	  request({
		url: 'groupon/goods/withdrawGrouponMoney',
		method: 'POST',
		data,
		custom: {
		  auth: true,
		},
	  }),
	// 团购收益
	tuangou_income: (data) =>
	  request({
		// baseURL:'https://api-dev2-xyh.jxzc.tjbj.cc/',
		url: 'groupon/goods/getGrouponMoneyList',
		method: 'POST',
		data,
		custom: {
		  auth: true,
		},
	  }),
// 团购核销记录
tuangou_log_hx: (params) =>
  otherRequest({
	url: '/index/clerk/verifyLog',
	method: 'GET',
	params,
	custom: {
	  auth: true,
	},
  }),
// 鲸喜生活券
surprise:{
	getLocation: (params) =>
	  otherRequest({
	    url: '/index/getLocation',
	    method: 'GET',
	    params,
	    custom: {
	      auth: true,
	    },
	  }),
	commentList: (params) =>
	  otherRequest({
	    url: '/index/LifeCircle/comment',
	    method: 'GET',
	    params,
	    custom: {
	      auth: true,
	    },
	  }),
	comment: (data) =>
	  otherRequest({
	    url: '/index/LifeCircle/sub_comment',
	    method: 'POST',
	    data,
	    custom: {
	      auth: true,
	    },
	  }),
	shopList: (data) =>
	  otherRequest({
	    url: '/index/life/store',
	    method: 'GET',
	    data,
	    custom: {
	      auth: true,
	    },
	  }),
	  shopDetail: (id) =>
	    otherRequest({
	      url: `/index/store/${id}`,
	      method: 'GET',
	      custom: {
	        auth: true,
	      },
	    }),
	shopPay: (data) =>
	  otherRequest({
		url: `/index/life/life_pay`,
		method: 'GET',
		data,
		custom: {
		  auth: true,
		},
	  }),
},



 // 
  test: (data) =>
    otherRequest({
		baseURL:'https://api-dev-shop.shisan-xi.work',
      url: '/index/life/life_pay',
      method: 'GET',
      data,
      custom: {
        loadingMsg: '支付中',
        auth: true,
      },
    }),


  // 商家收款 预支付
  shop_pay: (data) =>
    otherRequest({
      url: '/shop/api/pay/prepay',
      method: 'POST',
      data,
      custom: {
        loadingMsg: '支付中',
        auth: true,
      },
    }),

  init: (id) =>
    otherRequest({
      url: 'init',
      custom: {
        showError: false,
        showLoading: false,
      },
      params: {
        templateId: id,
      },
    }),
  order: (id) =>
    otherRequest({
      url: 'trade/order/' + id,
      method: 'GET',
      custom: {
        showLoading: false,
      },
    }),
  // 订单详情
  orderDetail: (id) =>
    otherRequest({
      url: 'order/order/' + id,
      method: 'GET',
    }),
  // 预支付
  
  prepay: (data) =>
    otherRequest({
      url: 'pay/prepay',
      method: 'POST',
      data,
      custom: {
        loadingMsg: '支付中',
      },
    }),
  //获取门
  // 门店入住
  apply: (data) =>
    otherRequest({
      url: '/operations/api/apply/add',
      method: 'POST',
      data,
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  //获取门店入住状态
  getStatus: () =>
    otherRequest({
      url: '/operations/api/apply/getStatus',
      method: 'POST',
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  //入驻门店的分类
  getCategoryList: () =>
    otherRequest({
      url: '/operations/api/category/getList',
      method: 'get',
      custom: {
        showLoading: false,
        auth: false,
      },
    }),
  //入驻门店的分类
  categoryList: () =>
    otherRequest({
      url: '/operations/api/category/list',
      method: 'get',
      custom: {
        showLoading: false,
        auth: false,
      },
    }),
  // 附近门店列表
  list: (params) =>
    otherRequest({
      url: '/operations/api/vicinalShop/list',
      method: 'GET',
      params,
      custom: {
        showLoading: true,
        auth: false,
      },
    }),
  //门店入驻详情
  detail: (id, params) =>
    otherRequest({
      url: '/operations/api/vicinalShop/detail/' + id,
      method: 'GET',
      params,
      custom: {
        showLoading: false,
        auth: false,
      },
    }),
  //搜索门店列表
  merchantList: (data) =>
    otherRequest({
      url: '/index/store',
      method: 'GET',
      data,
      custom: {
        showLoading: false,
        auth: false,
      },
    }),
  //门店详情
  merchantDetail: (id, params) =>
    otherRequest({
      url: '/index/store/' + id,
      method: 'GET',
      params,
      custom: {
        showLoading: false,
        auth: false,
      },
    }),
  //门店评价
  evaluate: (params) =>
    otherRequest({
      url: '/index/store/comment',
      method: 'GET',
      params,
      custom: {
        showLoading: false,
        auth: false,
      },
    }),
  // 团购详情
  groupDetails: (id) =>
    otherRequest({
      url: `/index/group_goods/${id}`,
      method: 'GET',
      custom: {
        showLoading: false,
        auth: false,
      },
    }),
  // 加入购物车
  groupAddCart: (data) =>
    otherRequest({
      url: `/index/cart`,
      method: 'POST',
      data,
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  // 收藏
  groupCollect: (id) =>
    otherRequest({
      url: `/index/group_goods/collect/${id}`,
      method: 'GET',
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  // 创建订单
  createGroup: (data) =>
    otherRequest({
      url: `/index/order/createOrder`,
      method: 'POST',
      data,
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  // 购物车列表
  groupCartList: (params) =>
    otherRequest({
      url: `/index/cart`,
      method: 'GET',
      params,
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  storeInfo: (params) =>
    otherRequest({
      url: `/index/clerk/getStore`,
      method: 'GET',
      params,
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  bindStore: (data) =>
    otherRequest({
      url: `/index/clerk/bind`,
      method: 'POST',
      data,
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  checkCode: (data) =>
    otherRequest({
      url: `/index/clerk/use`,
      method: 'POST',
      data,
      custom: {
        showLoading: false,
        auth: true,
      },
    }),
  // 扫码核销
  verify: (data) =>
    otherRequest({
      url: 'order/order/verify',
      method: 'POST',
      data,
      custom: {
        auth: true,
        showLoading: true,
      },
    }),
  send_share: (data) =>
    otherRequest({
      url: '/shop/api/share/goods',
      method: 'POST',
      data,
      custom: {
        auth: true,
        showLoading: true,
      },
    }),
	getUserInfoByImId: (params) =>
	  otherRequest({
	    url: '/shop/api/share/getUserInfoByImId',
	    method: 'GET',
	    params,
	    custom: {
	      auth: true,
	      showLoading: true,
	    },
	  }),
};
